{% extends "base.html" %}

{% block content %}
    <h1>新增类别</h1>
    {% if messages %}
        {% for message in messages %}
            <div class="alert alert-{{ message.tags }}">
                {{ message }}
            </div>
        {% endfor %}
    {% endif %}
    <form method="post">
        {% csrf_token %}
        <div class="mb-3">
            <label for="type" class="form-label">终端类型</label>
            <input type="text" class="form-control" id="type" name="type" required>
        </div>
        <div class="mb-3">
            <label for="category" class="form-label">类别</label>
            <input type="text" class="form-control" id="category" name="category" required>
        </div>
        <button type="submit" class="btn btn-primary">保存</button>
        <a href="{% url 'category_list' %}" class="btn btn-secondary">取消</a>
    </form>
{% endblock %}